<?php

global $FU;
include_once 'includes/type.php';
$config_dir = $FU->dir->config;
$td = TypeDomain::instance();
$td->addLoader(new KarniTypeLoader("$config_dir/type.d"));
$td->addLoader(new DocTypeLoader("$config_dir/conf.d/doctype.php"));

// add default types
$td->setType('atom'        , new TAtom());
$td->setType('object'      , new TObject());
$td->setType('collection'  , new TCollection(array()));
$td->cloneType('string'    , 'atom');
$td->cloneType('integer'   , 'atom');
$td->cloneType('bool'      , 'atom');
$td->aliasType('boolean'   , 'bool');
$td->cloneType('text'      , 'atom');
$td->cloneType('datetime'  , 'atom');
$td->cloneType('timestamp' , 'atom');

$ctx->td = $td;

